import { ApiService } from './api.service';

interface ChatResponse {
  reply: string;
}

export class ChatService {
  static async sendMessage(message: string, systemPrompt: string): Promise<string> {
    try {
      const response = await ApiService.post<ChatResponse>('chat', {
        message,
        systemPrompt,
      });
      return response.reply;
    } catch (error) {
      console.error('Chat Error:', error);
      throw error;
    }
  }
}